﻿@model GitCandy.Models.CommitsModel

@{
    ViewBag.Title = String.Format(SR.Shared_TitleFormat, String.Format(SR.Repository_CommitsTitle, Model.RepositoryName ?? Model.Sha.ToShortSha(), Model.Path));
}

<h4>@SR.Repository_HistoryFor @Html.ActionLink(Model.RepositoryName, "Tree", Html.OverRoute(new { path = "" }))</h4>

@Html.Partial("_PathBar", Model.PathBar)

@foreach (var commit in Model.Commits)
{
    <div class="border-area">
        <div class="row">
            <div class="col-md-9">
                <div title="@commit.CommitMessageShort">@Html.ActionLink(commit.CommitMessageShort.ShortString(100), "Commit", Html.OverRoute(new { path = commit.Sha + "/" + Model.Path }))</div>
                <strong title="@commit.Author">@Html.Link(commit.Author)</strong>
                <span>@SR.Repository_AuthoredAt</span>
                <span title="@commit.Author.When">@commit.Author.When.LocalDateTime.ToFullString()</span>
                @if (commit.Author != commit.Committer)
                {
                    <strong title="@commit.Committer">@Html.Link(commit.Committer)</strong>
                    <span>@SR.Repository_CommittedAt</span>
                    <span title="@commit.Committer.When">@commit.Committer.When.LocalDateTime.ToFullString()</span>
                }
            </div>
            <div class="col-md-3">
                <div class="text-right">@Html.ActionLink(commit.Sha.ToShortSha(), "Commit", Html.OverRoute(new { path = commit.Sha }))</div>
                <div class="text-right">@Html.ActionLink(SR.Repository_Tree, "Tree", Html.OverRoute(new { path = commit.Sha }))</div>
            </div>
        </div>
    </div>
}
@Html.Partial("_Pager")
